<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%log}}".
 *
 * @property string $id
 * @property int $uid
 * @property string $channel
 * @property string $page
 * @property string $access_url
 * @property string $referer_url
 * @property string $method
 * @property string $sess_id
 * @property integer $version
 * @property string $created_by
 * @property integer $created_at
 * @property string $created_from
 * @property string $created_ip
 * @property string $updated_by
 * @property integer $updated_at
 * @property string $updated_from
 * @property string $updated_ip
 * @property integer $is_deleted
 */
class AccessLog extends \common\base\BaseActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%access_log}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid','version', 'created_at', 'updated_at', 'is_deleted'], 'integer'],
            [[ 'channel',  'page',  'sess_id', 'method'], 'string', 'max' => 100],
            [['access_url', 'referer_url'], 'string', 'max' => 500],
            [['created_by', 'created_from', 'created_ip', 'updated_by', 'updated_from', 'updated_ip'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('common', 'id'),
            'uid' => Yii::t('common', 'uid'),
            'channel' => Yii::t('common', 'channel'),
            'page' => Yii::t('common', 'page'),
            'access_url' => Yii::t('common', 'access_url'),
            'referer_url' => Yii::t('common', 'referer_url'),
            'method' => Yii::t('common', 'method'),
            'sess_id' => Yii::t('common', 'sess_id'),
            'version' => Yii::t('common', 'version'),
            'created_by' => Yii::t('common', 'created_by'),
            'created_at' => Yii::t('common', 'created_at'),
            'created_from' => Yii::t('common', 'created_from'),
            'created_ip' => Yii::t('common', 'created_ip'),
            'updated_by' => Yii::t('common', 'updated_by'),
            'updated_at' => Yii::t('common', 'updated_at'),
            'updated_from' => Yii::t('common', 'updated_from'),
            'updated_ip' => Yii::t('common', 'updated_ip'),
            'is_deleted' => Yii::t('common', 'is_deleted'),
        ];
    }
}
